<?php
/********用户资料页面********/
if(!is_user_logged_in()) {
	wp_redirect(site_url()."/wp-login.php");
	exit;
}
global $wpdb, $post, $wp_query,$userdata, $wp_http_referer;
$query_vars = $wp_query->query_vars;
//$pagenum = isset($query_vars['paged']) ? $query_vars['paged'] : 1;
$pagenum = isset( $_GET['pagenum'] ) ? intval( $_GET['pagenum'] ) : 1;
$args = array(
	'author' => get_current_user_id(),
	'post_status' => array('publish'),
	//'post_type' => 'detail',
	'posts_per_page' => 20,
	'paged' => $pagenum
);
$dashboard_query = new WP_Query( $args );
?>

<div class="member_system">
    <div class="title_member" >总共发表文章：<?php echo $dashboard_query->found_posts;?>篇</div>
<?php if( $dashboard_query->have_posts() ) : ?>
<ul class="item-list" >
	<?php while ( $dashboard_query->have_posts() ) : $dashboard_query->the_post(); ?>
    <li> 
    <div class="item-info">
        <div class="user_list_title"  >
         <a href="<?php the_permalink(); ?>" target="_blank"><?php echo get_the_title();?></a>   
        </div>
    </div> 
    </li>
    <?php endwhile;?>  
</ul>
<?php
endif;
?>
</div>

<?php
$pagination = paginate_links( array(
	'base' => add_query_arg( 'pagenum', '%#%' ),
	'format' => '',
	'prev_text' => '上一页',
	'next_text' => '下一页',
	'total' => $dashboard_query->max_num_pages,
	'current' => $pagenum
	)
);
if ( $pagination ) {
	echo $pagination;
}
?>    